Home:ALL Converter>Open a text file in C# programmatically

Open a text file in C# programmatically

Ask Time:2014-01-14T16:41:13         Author:user3024468

Json Formatter

I want to open a text file programmatically using C#. I have used :

System.Diagnostics.Process.Start(test.txt);

but this code is causing OS command injection problem when scanning for threats.

Is there any way that i can open a text file programmatically?? or way to bypass that OS command injection?

Thank you

Author:user3024468,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/21109070/open-a-text-file-in-c-sharp-programmatically
omer schleifer :

You should call a program, say notepad:\n\nProcess.Start(\"notepad.exe\", fileName);\n\n\nthe argument is the file name:\n\n Process.Start(\"notepad.exe\", \"Test.txt\");\n\n\nSee the problem with your code in the comments of this post:\nOpen a file with Notepad in C#",
2014-01-14T08:43:54
yy